package com.zkthink.ceres.product.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;


@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_admin_product_contribution_config")
@ApiModel(value = "ProductContributionConfig", description = "平台贡献值设置表")
@AllArgsConstructor
public class ProductContributionConfig extends Entity<Long> {
    private static final long serialVersionUID = 1L;
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @TableField("product_id")
    @Excel(name = "商品id")
    private Long productId;

    /**
     * 贡献值：折扣*倍数
     */
    @ApiModelProperty(value = "贡献值：折扣*倍数")
    @TableField("discount_contribution")
    @Excel(name = "商品折扣比例")
    private Integer discountContribution;

    /**
     * 贡献值：商品售价*倍数
     */
    @ApiModelProperty(value = "贡献值：商品售价*倍数")
    @TableField("sale_contribution")
    @Excel(name = "直接分销折扣比例")
    private Integer saleContribution;
    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    private Integer isDelete;

    @Builder
    public ProductContributionConfig(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime, Integer isDelete,
                                 Long productId, Integer discountContribution, Integer saleContribution) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.isDelete = isDelete;
        this.productId=productId;
        this.discountContribution=discountContribution;
        this.saleContribution=saleContribution;
    }
}
